﻿using System;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using YJKView;
using StairsModuleAndEdit.StairsEdit.Common;
using StairsModuleAndEdit.StairsEdit.Managers;

namespace StairsModuleAndEdit.StairsEdit
{
	[Regeneration(RegenerationOption.Manual)]
	[Transaction(TransactionMode.Manual)]
	internal class CmdShowOrHideArchStairs : IExternalCommand
	{
		Result IExternalCommand.Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
		{
			CmdViewType types = (CmdViewType)127;
			if (SwitchView.SetUsableView(types, commandData) != Autodesk.Revit.UI.Result.Succeeded)
			{
				return Autodesk.Revit.UI.Result.Failed;
			}
			HideOrShowStairsCls hideOrShowStairsCls = new HideOrShowStairsCls(commandData);
			HideWarningKit @object = new HideWarningKit("显示面层");
			commandData.Application.Application.FailuresProcessing += @object.OnFailuresProcessing;
			HideWarningKit object2 = new HideWarningKit("完成模式");
			commandData.Application.Application.FailuresProcessing += object2.OnFailuresProcessing;
			HideWarningKit object3 = new HideWarningKit("Stairs Beam");
			commandData.Application.Application.FailuresProcessing += object3.OnFailuresProcessing;
			return hideOrShowStairsCls.HideOrShowStairsKit(ref message);
		}
	}
}
